import DialogBase from "../../../common/cmpt/base/DialogBase";
import Layer from "../../../common/cmpt/base/Layer";
import DlgGuide from "./DlgGuide";

const { ccclass, property } = cc._decorator;

const guideCase = [
    { cmd: 'click', args: 'Canvas/DialogLayer/DlgGudieCase/Btns/btn1', delayTime: null, text: '点击按钮1' },
    { cmd: 'click', args: 'Canvas/DialogLayer/DlgGudieCase/Btns/btn2', delayTime: null, text: '点击按钮2' },
    { cmd: 'click', args: 'Canvas/DialogLayer/DlgGudieCase/Btns/btn3', delayTime: null, text: '点击按钮3' },
]
@ccclass
export default class DlgGuideCase extends DialogBase {
    public static pUrl: string = 'LyDialog/DlgGuideCase'

    guideSpt: DlgGuide = null
    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}

    start() {
        this.initLocalGuide()
    }

    // update (dt) {}

    async initLocalGuide() {
        this.guideSpt = await Layer.inst.getGuide()
    }
    /**读取预设的引导流程 */
    getLocalGuideData() {
        this.guideSpt.startLocalGuide(guideCase)
        this.guideSpt.startGuide()
    }
    /**读取配置表的引导流程 */
    getExcelGuide() {
        this.guideSpt.getExcelGuide()
        this.guideSpt.startGuide()
    }

    public close() {
        super.close()
        Layer.inst.closeGuide()
    }
}
